meson: Reduce useless relinking on reconfigure
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 3 Apr 2020 11:58:18 +0000 (17:28 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 3 Apr 2020 13:11:55 +0000 (18:41 +0530)
commit777435c4708713f74279a02fb51910b1fbc841b4
treea7a84f2b69d5af758430a02bf4a318e5dfbd69e5
parentfb325afc79536c6c1547eb42e57fca1f9fa11b8b
meson: Reduce useless relinking on reconfigure

When we reconfigure, `configure_file()` is called again, and
`*.gresource.xml` files are regenerated, which causes many (all?)
binaries to be relinked. Now we only write those out if the contents
actually changed (or if the output didn't already exist).

This is exactly what Meson already does with `configure_file()` when
`command:` is not used.

While we're at it, also do the same for `gen-c-array.py` and
`gentypefuncs.py` for completeness. Now even if the input to those
changes, re-building of those custom targets may not result in
relinking if the outputted C files have the same contents.
gdk/broadway/gen-c-array.py
gdk/gen-gdk-gresources-xml.py
gsk/gen-gsk-gresources-xml.py
gtk/gen-gtk-gresources-xml.py
gtk/gentypefuncs.py